package com.wyp168.leetcode.listnode;

public class DeleteNode {
    public static void main(String[] args) {
        ListNode ln1 = new ListNode(1);
        ListNode ln2 = new ListNode(2);
        ListNode ln3 = new ListNode(3);
        ln1.next = ln2;
        ln2.next = ln3;

        deleteNode(ln2);

        System.out.println(ln1);

    }


    public static void deleteNode(ListNode node) {
        node.val = node.next.val;
        node.next = node.next.next;

    }
}
